//
//  NormalGoalSetupView.swift
//  DaRings
//
//  Created by 魔样科技 on 2022/11/11.
//

import Foundation
import MYModule

class GoalSetupNormalView: View {
    
    
    override func makeUI() {
        super.makeUI()
        
        self.addSubview(self.stepItem)
        self.stepItem.snp.makeConstraints { make in
            make.top.leading.trailing.equalToSuperview()
        }
        
        self.addSubview(self.kcalItem)
        self.kcalItem.snp.makeConstraints { make in
            make.top.equalTo(self.stepItem.snp.bottom)
            make.leading.trailing.equalToSuperview()
        }
        
        self.addSubview(self.durationItem)
        self.durationItem.snp.makeConstraints { make in
            make.top.equalTo(self.kcalItem.snp.bottom)
            make.leading.trailing.equalToSuperview()
            make.bottom.equalToSuperview()
        }
    }
    
    public func bindModel(model: NormalGoalModel) {
        self.stepItem.bindModel(model: model.trainingModel)
        self.kcalItem.bindModel(model: model.kcalModel)
        self.durationItem.bindModel(model: model.durationModel)
        
    }
    
    
    //MARK: - lazy load -
    lazy var stepItem: GoalSetupNormalItemView = {
        let view = GoalSetupNormalItemView()
        return view
    }()
    
    lazy var kcalItem: GoalSetupNormalItemView = {
        let view = GoalSetupNormalItemView()
        return view
    }()
    
    lazy var durationItem: GoalSetupDurationItemView = {
        let view = GoalSetupDurationItemView()
        return view
    }()
    
}
